
/*
 * cpu_adpll.h - CSP define of CPU ADPLL
 *
 * Copyright (C) 2016-2018, LomboTech Co.Ltd.
 * Author: lomboswer <lomboswer@lombotech.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#define RST_SCTRL_OFFSET	0x0
#define RST_CCTRL_OFFSET	0x4
#define CTRL_R_OFFSET		0x10
#define STATUS_R_OFFSET		0x50
#define GENER_REG_OFFSET	0x60
#define CLK_CNT_CTRL_OFFSET	0x70
#define HFEOSC_CNT_OFFSET	0x74
#define MODULE_CNT_OFFSET	0x78
#define CLK_SRC_OFFSET		0x7c
#define FAC_OFFSET		0x80
#define TUNE0_OFFSET		0x84
#define TUNE1_OFFSET		0x88
#define STAT_OFFSET		0x8c
#define VER_OFFSET		0xf0

#define MAX_PWM_DUTY_NS_OLD	2728
#define MIN_PWM_DUTY_NS_OLD	908
#define MAX_PWM_DUTY_NS		8899
#define MIN_PWM_DUTY_NS		806

void csp_set_cpu_clk_src_sel(u32 clk_src);
int csp_set_cpu_rate(void __iomem *base, unsigned int freq);
unsigned int csp_get_cpu_rate(void __iomem *base);
void csp_cpu_init(void __iomem *base);
#ifdef CONFIG_OLD_PWM_PARAM
#define PWM_PARAM_VERSION	0
#else
#define PWM_PARAM_VERSION	1
#endif

